/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Key;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import view.TableView;

/**
 *
 * @author Alex
 */
public class KeyManager extends KeyAdapter{
    @Override
    public void keyTyped(KeyEvent e)
    {
        if (e.getKeyChar() == KeyEvent.VK_ENTER)
        {
            TableView table = (TableView) e.getSource();
            int rowIndex = table.getSelectedRow();
            Object o = table.getModel().getValueAt(rowIndex, 0);
            table.doClick(o);
            e.consume();
        }
    }
}
